﻿@model IEnumerable<BudgetApp.Data.Models.TrackSpend>

@{
    ViewBag.Title = "Index";
}

<div class="col-md-12">
    <h2>Index</h2>

    <p>
        @Html.ActionLink("Create New", "Create")
    </p>
    <table class="table">
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.InputType.Type)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Category.CategoryType)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.SubCategory.SubCategoryType)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.DateSpent)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Amount)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Where)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Notes)
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.InputType.Type)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Category.CategoryType)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.SubCategory.SubCategoryType)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.DateSpent)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Amount)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Where)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Notes)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new {id = item.SpendId}) |
                    @Html.ActionLink("Details", "Details", new {id = item.SpendId}) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.SpendId })
                </td>
            </tr>
        }

    </table>
</div>